package com.szty.libarytest.imageCheck

import android.content.Context
import android.os.Bundle
import android.widget.ImageView
import androidx.appcompat.app.AppCompatActivity
import com.bumptech.glide.Glide
import com.luck.picture.lib.PictureSelector
import com.luck.picture.lib.entity.LocalMedia
import com.szty.libarytest.R
import kotlinx.android.synthetic.main.activity_image_check.*

class ImageCheckActivity : AppCompatActivity() {
    val pics = arrayListOf(
        "https://test.images.shenzhoutianyu.com/app/correct/bfd6df15f5c05105cc0fa71a5f5220f5.png",
        "https://test.images.shenzhoutianyu.com/app/correct/2c787e8c5fdfe3f2165bd897cb1195b3.png",
        "https://test.images.shenzhoutianyu.com/app/correct/ce5a47611de1ad7d1e72e3c55949544f.png"
    )

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_image_check)
        btn_check_pic.setOnClickListener {
            val medial = arrayListOf<LocalMedia>()
            pics.forEach {
                medial.add(LocalMedia(it,0L,0,"image/*"))
            }
            PictureSelector.create(this)
                .themeStyle(R.style.picture_default_style)
                .isNotPreviewDownload(true)
                .imageEngine(GlideEngine.createGlideEngine())
                .openExternalPreview(0,medial)
        }
    }
}